<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $title;?></title>
<meta name="keywords" content="<?php echo $title;?>" />
<meta name="description" content="<?php echo $title;?>" />
<!--头部开始-->
 <?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<link href="http://127.0.0.1/cms/cms/Template/black/css/base.css" rel="stylesheet">
<link href="http://127.0.0.1/cms/cms/Template/black/css/index.css" rel="stylesheet">
<link href="http://127.0.0.1/cms/cms/Template/black/css/media.css" rel="stylesheet">
<link href="http://127.0.0.1/cms/cms/Template/black/css/style.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<!--[if lt IE 9]>
<script src="js/modernizr.js"></script>
<![endif]-->
</head>

<body>
	<div class="ibody">
		<header>
			<h1><?php echo $title;?></h1>
			<h2>我的生活像 拍了一出戏 有超多导演跟编剧</h2>
			<nav id="topnav">
				<a href="http://127.0.0.1/cms/cms/index.php">首页</a>
				<?php
	$navList = M('category')->field('cid,cname,ctitle,htmldir,is_archtml')->where('pid=0')->limit(10)->all();
	foreach($navList as $navs):
	$navs['url'] = getCateUrl($navs['is_archtml'],$navs['htmldir'],$navs['cid']);
?>
	
					<a href="http://127.0.0.1/cms/cms/index.php/Index/list/index/cid/<?php echo $navs['cid'];?>"><?php echo $navs['cname'];?></a>
				
<?php
	endforeach;
?>
			</nav>
		</header>
<!--头部结束-->
  <article>
    <h2 class="about_h"><!--您现在的位置是：<a href="/">首页</a>><a href="1/">慢生活</a>--></h2>
   
    <div class="bloglist">
    <?php
		//总条数
		$count = M('article')->where(" is_recycle=0 AND category_cid IN(32)")->count();
		$pageObj = new Page($count,15,10);
		$page = $pageObj->show();
		$result = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where(" is_recycle=0 AND category_cid IN(32)")->order("sendtime DESC")->limit($pageObj->limit())->all();
		foreach($result as $art):
			$aid = $art['aid'];
			$art['commentcount'] = M('comment')->where("article_aid=$aid")->count();
			$art['description'] = M('article_data')->where("article_aid=$aid")->getField('description');
			$art['url'] = getStaticPath($art['is_archtml'],$art['htmldir'],$art['aid']);
			$c = K('Category')->findCate($art['category_cid']);
			$art['category_name'] = $c['cname'];
			$art['curl'] = getCateUrl($art['is_listhtml'],$art['htmldir'],$art['cid'].'.html');
			$art['thumb']  = 'http://127.0.0.1/cms/cms/'.$art['thumb'];
?>
	
      <div class="newblog">
        <ul>
          <h3><a href="<?php echo $art['url'];?>"><?php echo $art['title'];?></a></h3>
          <div class="autor"><span>作者：<?php echo $art['author'];?></span><span>分类：[<a href="<?php echo $art['curl'];?>"><?php echo $art['category_name'];?></a>]</span><span>浏览（<a href="/"><?php echo $art['click'];?></a>）</span><span></span></div>
          <p><?php echo $art['digest'];?> <a href="<?php echo $art['url'];?>" target="_blank" class="readmore">全文</a></p>
        </ul>
        <figure><a href="<?php echo $art['thumb'];?>"><img src="<?php echo $art['thumb'];?>" ></a></figure>
        <div class="dateview"><?php echo date('Y-m-d',$art['sendtime']);?></div>
      </div>
      
<?php
	endforeach;
?>
    </div>
    <div class="page"><?php echo $page;?></div>
  </article>
  <!--右边开始-->
 <?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
 <aside>
    <div class="avatar"><a href="about.html"><span>关于邦</span></a></div>
    <div class="topspaceinfo">
      <h1><?php echo $title;?></h1>
      <p>我的生活像 拍了一出戏 有超多导演跟编剧</p>
    </div>
    <div class="about_c">
      <p>网名：邦 </p>
      <p>职业：PHPer </p>
      <p>籍贯：江西省-赣州市</p>
      <p>电话：18650680200</p>
      <p>邮箱：375500819@qq.com</p>
    </div>
    
    <div class="tj_news">
      <h2>
        <p class="tj_t1">最新文章</p>
      </h2>
      <ul>
      	<?php
		$result = M('article')->field('htmldir,cname,is_archtml,aid,sendtime,click,title,thumb,digest,author,category_cid')->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where('is_recycle=0')->order('sendtime DESC')->limit(10)->all();
		foreach($result as $v):
			//组合图片图片
			$v['thumb']  = 'http://127.0.0.1/cms/cms/'.$v['thumb'];
			$v['commnum'] = K('Comment')->findCountComment($v['aid']);
			$category = K('Category')->findCate($v['category_cid']);
			$v['category_name'] = $category['cname'];
			//生成连接地址
			$v['url'] = getStaticPath($v['is_archtml'],$v['htmldir'],$v['aid']);
			
			 
?>	
	
        	<li><a href="<?php echo $v['url'];?>"><?php echo $v['title'];?></a></li>
        
<?php
	endforeach;
?>	
      </ul>
      <h2>
        <p class="tj_t2">推荐文章</p>
      </h2>
      <ul>
      	<?php
		$result = K('article')->findSpeExp('is_recycle=0 AND attr LIKE "%推荐%"','click DESC',8);
		foreach($result as $recom):
		$recom['thumb']  = 'http://127.0.0.1/cms/cms/'.$recom['thumb'];
		$recom['commnum'] = K('Comment')->findCountComment($recom['aid']);
		//生成连接地址
		$recom['url'] = getStaticPath($recom['is_archtml'],$recom['htmldir'],$recom['aid']);
?>
		
        <li><a href="<?php echo $recom['url'];?>"><?php echo $recom['title'];?></a></li>
        
<?php
	endforeach;
?>
      </ul>
    </div>
    <div class="links">
      <h2>
        <p>友情链接</p>
      </h2>
      <ul>
      	<?php
		$result = K('flink')->showAllFlink(1,10,'sort DESC');
		foreach($result as $flink):
		$flink['url'] = 'http://'.$flink['url'];
		$flink['logo']  = 'http://127.0.0.1/cms/cms/'.$flink['logo'];
		
?>
	
        <li><a href="<?php echo $flink['url'];?>"><?php echo $flink['fname'];?></a></li>
        
<?php
	endforeach;
?>	
      </ul>
    </div>
    <div class="copyright">
      <ul>
        <p> Design by <a href="/"><?php echo $title;?></a></p>
        <p></p>
        </p>
      </ul>
    </div>
  </aside>
 <!--右边结束-->
  <script src="js/silder.js"></script>
  <div class="clear"></div>
  <!-- 清除浮动 --> 
</div>
</body>
</html>
